const Router = require('koa-router')
const router = new Router()
const koaBody = require('koa-bodyparser');

const GTP = require('../model/GTP');

router.prefix('/topic');

router.get('/get_topicf/:attribute',async ctx=>{
    const attribute = ctx.params.attribute;
    const rows = await GTP.GETTOPICF(attribute);
    ctx.body = rows;
    
})

router.get('/get_topics/:next_num',async ctx=>{
    const next_num = ctx.params.next_num;
    const rows = await GTP.GETTOPIC(next_num);
    ctx.body = rows;
})
module.exports = router;